<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="purchaseOrder" type="PurchaseOrder" />
  <xs:complexType name="PurchaseOrder">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="shipTo" type="USAddress" />
      <xs:element minOccurs="0" maxOccurs="1" name="billTo" type="USAddress" />
      <xs:element minOccurs="0" maxOccurs="1" name="comment" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Items" type="ArrayOfOrderItem" />
    </xs:sequence>
    <xs:attribute name="orderDate" type="xs:date" />
  </xs:complexType>
  <xs:complexType name="USAddress">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="name" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="street" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="city" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="state" type="xs:string" />
      <xs:element minOccurs="1" maxOccurs="1" name="zip" type="xs:decimal" />
    </xs:sequence>
    <xs:attribute name="country" type="xs:NMTOKEN" />
  </xs:complexType>
  <xs:complexType name="ArrayOfOrderItem">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="item" type="OrderItem" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="OrderItem">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="productName" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="quantity" type="xs:positiveInteger" />
      <xs:element minOccurs="1" maxOccurs="1" name="price" type="xs:decimal" />
      <xs:element minOccurs="0" maxOccurs="1" name="comment" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="shipDate" type="xs:date" />
    </xs:sequence>
    <xs:attribute name="partNum" type="xs:string" />
  </xs:complexType>
</xs:schema>
